<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">


<head>
    <title th:text="${pageTitle}"></title>
    <div data-th-replace="layout/head-top"></div>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInLeft">
    <div data-th-replace="common/functionDepict"></div>

    <div>
        <div class="row">
            <div class="pt10">
                <div class="col-sm-9">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title"><h5>填写基本信息</h5></div>
                        <form id="classes-form">

                            <input hidden id="id" name="id" th:value="${classes['id']}" />
                            <input hidden id="imageJson" name="imageJson" th:value="${classes['imageJson']}" />

                            <div class="ibox-content">
                                <div class="form-horizontal">
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 班级名称</label>
                                        <div class="col-sm-8">
                                            <input placeholder="班级名称" name="name" class="form-control validate-data">
                                            <span class="help-block m-b-none c-999"> 班级名称</span>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>

                                    <div class="form-group">
                                        <input type="hidden" name="subjectIds" id="subjectIds" th:value="${classes['subjectIds']}"/>
                                        <label class="col-sm-2 control-label"><i class="c-red">*</i> 专业</label>
                                        <div class="col-sm-8">
                                            <div id="classes-subject-box"></div>
                                            <div id="classes-subject-context"></div>
                                            <span class="help-block m-b-none c-999">选择专业或新建</span>
                                        </div>
                                        <div class="col-sm-2 mt10">
                                            <a href="javascript:void(0)" onclick="getRedirectMenu(baseloaction+'/admin/manage/subject/toSubjectList')">
                                                <i class="fa fa-plus"></i> 新建专业
                                            </a>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label text-right"> 人数限制</label>
                                        <div class="col-sm-8">
                                            <input placeholder="班级学员人数限制" name="studentLimitCount" class="form-control  validate-data" />
                                            <span class="help-block m-b-none c-999">  班级内最多可加入的学员数。当学员数达到此限制时，班级变为满班状态，不可再加入新学员。不填或0表示无限制</span>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>

                                    <div class="form-group">
                                        <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 班级类型</label>
                                        <div class="col-sm-8">
                                            <div class="radio i-checks">
                                                <label><input name="classesType" type="radio" value="1" th:checked="${classes['classesType']} == 1"><i></i> 课程班级</label>
                                                <label><input name="classesType" type="radio" value="2" checked><i></i> 自由班级</label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>

                                    <div class="form-group" th:classappend="${classes['classType'] != 1} ? 'hide'">
                                        <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 限定课程</label>
                                        <div class="col-sm-9">
                                            <p>
                                                <button class="btn btn-primary" id="selectCourse" type="button"><i class="fa fa-mouse-pointer"></i> &nbsp;选择课程</button>
                                            </p>
                                            <div class="pt10">
                                                <table class="table table-bordered table-hover">
                                                    <thead>
                                                    <tr>
                                                        <td class="text-center">ID</td>
                                                        <td class="text-center">课程名称</td>
                                                        <td class="text-center">操作</td>
                                                    </tr>
                                                    </thead>
                                                    <tbody id="classes-course">
                                                    <tr>
                                                        <td colspan="3" class="text-center">
                                                            <div class="noDataTipsBox">
                                                                <p><span>选择课程</span></p>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    </tbody>
                                                </table>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed" th:classappend="${classes['classType'] != 1} ? 'hide'"></div>

                                    <div class="form-group">
                                        <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 班级图标</label>
                                        <div class="col-sm-8">
                                            <p>
                                                <button class="btn btn-primary" type="button" id="select-image"><i class="fa fa-image"></i>&nbsp;选择班级图标</button>
                                                <span>
                                                    <small class="fs12 c-red">
                                                        &nbsp;&nbsp;&nbsp;*&nbsp;建议最大尺寸(宽*高 px)：380*380&nbsp;&nbsp;或者比例:&nbsp;1:1
                                                    </small>
                                                </span>
                                            </p>
                                            <div class="clearfix" id="coverImage">
                                                <div class="file-box">
                                                    <div class="file">
                                                        <span class="corner" id="remove-image" title="删除132"><i class="fa fa-remove"></i></span>
                                                        <div class="image">
                                                            <img alt="这是图标" id="material-image" class="img-responsive" th:src="@{{path}/admin/v3/img/default/default-pic.jpg?v={v}(path=${staticPath},v=${v})}" >
                                                        </div>
                                                        <div class="file-name">
                                                            <p id="file-name" th:text="'文件名'"></p>
                                                            <small id="upload-time" th:text="'上传时间'"></small>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>

                                    <div class="form-group">
                                        <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 班级简介</label>
                                        <div class="col-sm-8">
                                            <textarea placeholder="班级简介" name="summary" class="form-control validate-data" rows="5" cols="30" style="resize: none"></textarea>
                                            <span class="help-block m-b-none c-999">  班级简介，不超过255个字符</span>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>

                                    <div class="form-group ">
                                        <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 选择班主任</label>
                                        <div class="col-sm-9">
                                            <p>
                                                <button class="btn btn-primary" type="button" id="selectHeadmaster"><i class="fa fa-mouse-pointer"></i> &nbsp;选择班主任</button>
                                            </p>
                                            <div class="pt10" id="sysUser-content-table-hd">
                                                <table class="table table-bordered table-hover">
                                                    <thead>
                                                    <tr>
                                                        <td class="text-center">ID</td>
                                                        <td class="text-center">真实姓名</td>
                                                        <td class="text-center">操作</td>
                                                    </tr>
                                                    </thead>
                                                    <tbody id="classes-headmaster">
                                                    <tr>
                                                        <td colspan="3" class="text-center">
                                                            <div class="noDataTipsBox">
                                                                <p><span>选择班主任</span></p>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    </tbody>
                                                </table>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed "></div>

                                    <div class="form-group">
                                        <div class="col-sm-8 col-sm-offset-2">
                                            <button class="btn btn-primary" type="button" id="saveReturn">发布，返回</button>
                                            <button class="btn btn-primary" type="button" id="saveImport">发布，导入学员</button>
                                            <button class="btn btn-white ml10" type="button" id="saveCancel">取消</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <div data-th-replace="common/importantNotes"></div>
            </div>
        </div>
    </div>
</div>
<div data-th-replace="layout/head-footer"></div>
<script type="text/javascript" th:src="@{{path}/admin/business/upload/common-webuploader.js?v={v}(path=${staticPath},v=${v})}"></script>
<script type="text/javascript" th:src="@{{path}/admin/business/course/cou/select-common-course.js?v={v}(path=${staticPath},v=${v})}"></script>
<script type="text/javascript" th:src="@{{path}/admin/business/manage/teacher/common-select-teacher-list.js?v={v}(path=${staticPath},v=${v})}"></script>
<script type="text/javascript" th:src="@{{path}/admin/business/classes/save-classes.js?v={v}(path=${staticPath},v=${v})}"></script>
</body>
</html>
